************************************************
Replication file for "Lobbyists into Government", QJPS
Benjamin C.K. Egerod and Joshua McCrain (coresponding author, josh.mccrain@gmail.com)
************************************************

*** Table of contents

* `Data` folder:
** combined_panel.RData - primary dataset for panel model main results
** firm_comp.RData - auxiliary dataset for generating some descriptives about firms' revolving door lobbyists
** firm_experience_panels.RData - additional firm-lobbying period data for supplementary results and descriptives
** firm_panel.RData - a basic firm-lobbying period panel for descriptives and some models
** firm_panel_issues.RData - firm-lobbying period panel with covariates for dividing firms by specialization
** firm_panel_revenue_distributions.RData - information on firms' revenue concentation
** FirmPanel_10102018.csv - lobbying data for Trump administration robustness results
** issue_panel.RData - issue areas that firms lobby on
** prev_exp_agency.RData - information on which agencies lobbyists enter into
** staff_bg.RData - supplementary data on lobbyist-congressional staffers for descriptives
** staff_desc.RData - supplementary data on lobbyist-congressional staffers for descriptives
** staff_firms_info.RData - firm-lobbying period panel with additional detail on staffer destinations
** staff_party.RData - firm-lobbying period panel with party of congressional staffers that were lobbyists
** staff_party_main_results.RData - firm-lobbying period panel with party of congressional staffers that were lobbyists for supplementary analysis


* `images` folder:
** (Empty folder into which code will output figures)


* `scripts` folder:
** descriptives.R - primary code file for descriptive tables and figures
** descriptives_qjps.R - supplementary code file for descriptives
** did_client_concentration.R - code file for results on firms' concentration of clients
** did_combined_panel.R - code file with the majority of the analyses for the paper
** did_quantile.R - code file with analyses for assessing heterogeneity of effects by firm size
** did_staff_party.R - code file with analyses on party differences
** generalized_sensitivity.R - sensitivity analysis
** illustrative_graph.R - file that produces Goodman-Bacon figures
** trump results.R - file that produces supplementary Trump administration results
** varying_att_over_time.R - file that produces figure showing time-varying nature of ATT


* `tables` folder:
** (Empty folder into which code will output tables)


################################################


*** Tables and Figures:

* Tables:
1) Table 1: descriptives.R (NOTE: this is the only table in the replication file that MUST be produced by hand)
2) Table 2: did_combined_panel.R
3) Table 3: did_combined_panel.R
4) Table 4: did_client_concentration.R
5) Table 5: did_combined_panel.R
6) Table 6: did_combined_panel.R
7) Table A1: descriptives.R
8) Table A2: descriptives.R
9) Table A3: descriptives_qjps.R
10) Table D4: did_combined_panel.R
11) Table D5: did_combined_panel.R
12) Table D6: did_combined_panel.R
13) Table D7: did_combined_panel.R
14) Table D8: did_combined_panel.R
15) Table D9: did_combined_panel.R
16) Table D10: did_combined_panel.R
17) Table D11: did_staff_party.R
18) Table D12: did_client_concentration.R
19) Table D13: did_client_concentration.R
20) Table D14: did_client_concentration.R
21) Table D15: did_combined_panel.R
22) Table E16: trump results.R
23) Table E17: trump results.R


* Figures:
1) Figure 1: descriptives.R
2) Figure 2: descriptives.R
3) Figure 3: did_combined_panel.R
4) Figure 4: did_combined_panel.R
5) Figure 5: generalized_sensitivity.R
6) Figure A1: descriptives.R
7) Figure A2: descriptives.R
8) Figure B3: illustrative_graph.R
9) Figure B4: varying_att_over_time.R
10) Figure B5: did_combined_panel.R
11) Figure C6: did_combined_panel.R
12) Figure C7: did_combined_panel.R
13) Figure D8: did_combined_panel.R
14) Figure D9: varying_att_over_time.R
15) Figure D10: did_quantile.R
16) Figure E11: trump results.R

################################################

*** Software

All analyses were conducted with R version >= 4.0 

R packages were most up to date package versions as of November 2021. 
Any exceptions to this rule are noted explicitly in the code and will prompt the user to install a particular version of the package. 
Otherwise, the code does not specify to install packages, just loads the library of the package.

Seeds are set where appropriate in the individual code files.


################################################

*** Additional notes

* To properly load in data files and output tables and figures, set the working directory in RStudio to the source file location.
* Construction of the datasets is described in detail in the manuscript and appendix.
* Some of the panel models can take quite a while to run.